<?php

/**
 * Trida entity domeny.
 *
 * @author David Dusek
 */
namespace CMS\Updater\Models;

use Doctrine\ORM\Mapping as ORM;

/** 
 * @ORM\Entity
 * @ORM\Table(name="updater_domain")
 */
class Domain extends \Nette\Object {    
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     * @var int 
     */
    private $id;
    
    /**
     * @ORM\Column(name="`name`", length=100)
     * @var string 
     */
    private $name;
    
    /**
     * @ORM\manyToOne(targetEntity="\CMS\Updater\Models\Template", inversedBy="domains")
     * @ORM\joinColumn(name="template_id", referencedColumnName="id")
     */
    private $template;
    
    /**
     * @ORM\Column(length=255)
     * @var string 
     */
    private $url;
    
    /**
     * @ORM\Column(name="shared_key", length=50)
     * @var string 
     */
    private $sharedKey;
    
    /**
     * @ORM\Column(type="boolean")
     * @var boolean 
     */
    private $deleted = 0;
    
    
    public function getId() {
        return $this->id;
    }
    
    public function setName($name) {
        $this->name = $name; 
    }

    public function getName() {
        return $this->name;
    }

    public function setTemplate(Template $template) {
        $this->template = $template;
    }
    
    public function setTemplateNull() {
        $this->template = null;
    }
    
    public function getTemplate() {
        return $this->template;
    }    
    
    public function setUrl($url) {
        $this->url = $url; 
    }

    public function getUrl() {
        return $this->url;
    }

    public function setSharedKey($sharedKey) {
        $this->sharedKey = $sharedKey; 
    }

    public function getSharedKey() {
        return $this->sharedKey;
    }
    
    public function setDeleted($deleted) {
        $this->deleted = $deleted; 
    }

    public function getDeleted() {
        return $this->deleted;
    }

}
